<?php

/**
 * tblUsers filter form base class.
 *
 * @package    travis
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasetblUsersFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'title'             => new sfWidgetFormFilterInput(),
      'title_he'          => new sfWidgetFormFilterInput(),
      'title_ru'          => new sfWidgetFormFilterInput(),
      'first_name'        => new sfWidgetFormFilterInput(),
      'last_name'         => new sfWidgetFormFilterInput(),
      'email'             => new sfWidgetFormFilterInput(),
      'password'          => new sfWidgetFormFilterInput(),
      'phone1'            => new sfWidgetFormFilterInput(),
      'phone2'            => new sfWidgetFormFilterInput(),
      'fax'               => new sfWidgetFormFilterInput(),
      'type'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'status'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'country'           => new sfWidgetFormFilterInput(),
      'region'            => new sfWidgetFormFilterInput(),
      'city'              => new sfWidgetFormFilterInput(),
      'address'           => new sfWidgetFormFilterInput(),
      'working_time_from' => new sfWidgetFormFilterInput(),
      'working_time_to'   => new sfWidgetFormFilterInput(),
      'scype'             => new sfWidgetFormFilterInput(),
      'website'           => new sfWidgetFormFilterInput(),
      'description_en'    => new sfWidgetFormFilterInput(),
      'description_he'    => new sfWidgetFormFilterInput(),
      'description_ru'    => new sfWidgetFormFilterInput(),
      'logo'              => new sfWidgetFormFilterInput(),
      'latitude'          => new sfWidgetFormFilterInput(),
      'logitude'          => new sfWidgetFormFilterInput(),
      'permissions'       => new sfWidgetFormFilterInput(),
      'commissions'       => new sfWidgetFormFilterInput(),
      'balance'           => new sfWidgetFormFilterInput(),
      'credit'            => new sfWidgetFormFilterInput(),
      'orders'            => new sfWidgetFormFilterInput(),
      'reputation'        => new sfWidgetFormFilterInput(),
      'language'          => new sfWidgetFormFilterInput(),
      'create_time'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'update_time'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'title'             => new sfValidatorPass(array('required' => false)),
      'title_he'          => new sfValidatorPass(array('required' => false)),
      'title_ru'          => new sfValidatorPass(array('required' => false)),
      'first_name'        => new sfValidatorPass(array('required' => false)),
      'last_name'         => new sfValidatorPass(array('required' => false)),
      'email'             => new sfValidatorPass(array('required' => false)),
      'password'          => new sfValidatorPass(array('required' => false)),
      'phone1'            => new sfValidatorPass(array('required' => false)),
      'phone2'            => new sfValidatorPass(array('required' => false)),
      'fax'               => new sfValidatorPass(array('required' => false)),
      'type'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'status'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'country'           => new sfValidatorPass(array('required' => false)),
      'region'            => new sfValidatorPass(array('required' => false)),
      'city'              => new sfValidatorPass(array('required' => false)),
      'address'           => new sfValidatorPass(array('required' => false)),
      'working_time_from' => new sfValidatorPass(array('required' => false)),
      'working_time_to'   => new sfValidatorPass(array('required' => false)),
      'scype'             => new sfValidatorPass(array('required' => false)),
      'website'           => new sfValidatorPass(array('required' => false)),
      'description_en'    => new sfValidatorPass(array('required' => false)),
      'description_he'    => new sfValidatorPass(array('required' => false)),
      'description_ru'    => new sfValidatorPass(array('required' => false)),
      'logo'              => new sfValidatorPass(array('required' => false)),
      'latitude'          => new sfValidatorPass(array('required' => false)),
      'logitude'          => new sfValidatorPass(array('required' => false)),
      'permissions'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'commissions'       => new sfValidatorPass(array('required' => false)),
      'balance'           => new sfValidatorPass(array('required' => false)),
      'credit'            => new sfValidatorPass(array('required' => false)),
      'orders'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'reputation'        => new sfValidatorPass(array('required' => false)),
      'language'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'create_time'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'update_time'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('tbl_users_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'tblUsers';
  }

  public function getFields()
  {
    return array(
      'id'                => 'Number',
      'title'             => 'Text',
      'title_he'          => 'Text',
      'title_ru'          => 'Text',
      'first_name'        => 'Text',
      'last_name'         => 'Text',
      'email'             => 'Text',
      'password'          => 'Text',
      'phone1'            => 'Text',
      'phone2'            => 'Text',
      'fax'               => 'Text',
      'type'              => 'Number',
      'status'            => 'Number',
      'country'           => 'Text',
      'region'            => 'Text',
      'city'              => 'Text',
      'address'           => 'Text',
      'working_time_from' => 'Text',
      'working_time_to'   => 'Text',
      'scype'             => 'Text',
      'website'           => 'Text',
      'description_en'    => 'Text',
      'description_he'    => 'Text',
      'description_ru'    => 'Text',
      'logo'              => 'Text',
      'latitude'          => 'Text',
      'logitude'          => 'Text',
      'permissions'       => 'Number',
      'commissions'       => 'Text',
      'balance'           => 'Text',
      'credit'            => 'Text',
      'orders'            => 'Number',
      'reputation'        => 'Text',
      'language'          => 'Number',
      'create_time'       => 'Date',
      'update_time'       => 'Date',
    );
  }
}
